<!--
 * @Descripttion: 
 * @version: 
 * @Author: ada.wu
 * @Date: 2024-03-12 10:34:15
 * @LastEditors: ada.wu
 * @LastEditTime: 2024-04-07 14:01:12
   1  单选题 是非题  2  判断题  3  多选题 4  问答题 开放题 5  量表题  新加的
-->
<template>
  <div>
    <van-cell v-for="(subject,index) in examList" :key="index">
      <template #title>
        <div class="p-tb-xs">
          <font v-if="subject.isMust=='1'" color="#FF3138">*</font>
          {{((currentPage-1)*pageSize)+(index+1)}}.{{subject.examSubjectName}}
        </div>
      </template>
      <template #label>
        <template v-if="subject.examSubjectType == EXAM_SUBJECT_TYPE.INPUT">
          <van-field v-model="subject.examSubjectAns" placeholder="请输入" type="textarea" rows="1" autosize />
        </template>
        <template v-else-if="subject.examSubjectType == EXAM_SUBJECT_TYPE.NPS">
          <NPS :examSubjectDto="subject"></NPS>
        </template>
        <template v-else-if="subject.examSubjectType == EXAM_SUBJECT_TYPE.RADIO">
          <ExamRadio :examSubjectDto="subject"></ExamRadio>
        </template>
      </template>
    </van-cell>
  </div>
</template>

<script lang="ts">
import { defineComponent, toRefs } from "vue";

import ExamConfig from "/@/hooks/examConfig";
import NPS from "./NPS.vue";
import ExamRadio from "./ExamRadio.vue";
import { RadioGroup, Radio } from "vant";
export default defineComponent({
  props: {
    pageSize: {
      type: Number,
      default: 1,
    },
    currentPage: {
      type: Number,
      default: 1,
    },
    examDto: {
      type: Object,
      default: () => ({}),
    },
    examList: {
      type: Array,
      default: () => [],
    } as any,
  },
  components: {
    NPS,
    ExamRadio,
    [Radio.name]: Radio,
    [RadioGroup.name]: RadioGroup,
  },
  setup(props, { emit }) {
    return {
      ...toRefs(props),
      ...ExamConfig(),
    };
  },
});
</script>

<style lang="scss" scoped>
::v-deep(.van-cell__title) {
  font-weight: 500;
  font-size: 16px;
  color: #262626;
}
::v-deep(.van-cell__label) {
  font-weight: 400;
  font-size: 16px;
  color: #555555;
  padding-bottom: 20px;
}
::v-deep(.van-cell:after) {
  border: none;
}
::v-deep(.van-field) {
  border-radius: 5px;
  border: 1px solid $bs-color;
}
</style>

